import { ref } from 'vue'
import { defineStore } from "pinia";
export const useUserInfoStore = defineStore('userInfo', () => {
    const info = ref({})

    const setInfo = (newInfo) => {
        info.value = newInfo
    }
    const removeInfo = () => {
        info.value = ''
    }
    return { info, setInfo, removeInfo }
}, {
    persist: {
		storage: {
		        setItem(key, value) {
		          uni.setStorageSync(key, value) // [!code warning]
		        },
		        getItem(key) {
		          return uni.getStorageSync(key) // [!code warning]
		        },
		      },
	},
	unistorage:true
})
// export default useUserInfoStore;
